import axios from '@/utils/request'

// 获取用户列表
const getUserList = (data: object) => {
  return axios({
    url: '/user/list',
    params: data
  })
}

// 更改用户状态
const changeUserStataus = (data: any) => {
  return axios({
    url: '/user/status',
    method: 'POST',
    data
  })
}

const deleteUser = (data: any) => {
  return axios({
    url: '/user/remove',
    method: 'POST',
    data
  })
}

// 新增用户
const addUser = (data: any) => {
  return axios({
    url: '/user/add',
    method: 'POST',
    data
  })
}

// 修改用户
const updateUser = (data: any) => {
  return axios({
    url: '/user/edit',
    method: 'POST',
    data
  })
}

export { getUserList, changeUserStataus, deleteUser, addUser, updateUser }
